#include <stdio.h>
#include <gmp.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <vector>

#include <tpl.h>

static void load_primes(std::vector<mpz_t> &primes) {
}

static void dump_primes(const std::vector<mpz_t> &primes) {
}

int main(int argc, char **argv) {
  int factors = 0;
#define MAX_FACTORS	128
  mpz_t primes[MAX_FACTORS];
  int powers[MAX_FACTORS];

  mpz_t a;
  mpz_init(a);
  mpz_set_str(a, argv[1], 10);

  mpz_t p;
  mpz_init(p);

  mpz_set_ui(p, 2UL);

  mpz_t left;
  mpz_init(left);
  mpz_set(left, a);

  std::vector<mpz_t> primes;
  load_primes(primes);

  do {
    if (mpz_divisible_p(left, p) != 0) {
      mpz_t biggest_power;

      mpz_init(biggest_power);

      mpz_set(biggest_power, p);

      unsigned long power = 1;
      do {
      } while (mpz_divisible(left, p)
    }
  } while (mpz_cmp_ui(a, 1UL) > 0);

  printf("prime factors decomposition of ");
  mpz_out_str(stdout, 10, a);
  printf(" is ");

  int i;
  for (i = 0; i < factors; i++) {
    mpz_out_str(stdout, 10, primes[i]);
    printf("^%d", powers[i]);
  }

  printf("\n");
}
